# https://kubernetes.io/docs/concepts/services-networking/ingress/#the-ingress-resource

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: {{ ingress_name }}
  namespace: {{ namespace }}
  annotations:
    kubesphere.io/description: {{ kubesphere_description }}
    nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
  rules:
  - host: {{ domain }}
    http:
      paths:
      - path: {{ path }}
        pathType: Prefix
        backend:
          service:
            name: {{ svc_name }}
            port:
{%- if app == 'java' %}
              number: 3001
{%- elif app == 'vue' %}
              number: 80
{%- else %}
              number: 8080
{%- endif %}
